home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / text / rtf / RTFReader$FonttblDestination.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  2.2 KB  |  68 lines

  1. package javax.swing.text.rtf;
  2.  
  3. import java.util.Dictionary;
  4. import java.util.Enumeration;
  5.  
  6. class RTFReader$FonttblDestination implements RTFReader.Destination {
  7.    // $FF: synthetic field
  8.    private final RTFReader this$0;
  9.    int nextFontNumber;
  10.    String nextFontFamily;
  11.  
  12.    RTFReader$FonttblDestination(RTFReader var1) {
  13.       this.this$0 = var1;
  14.    }
  15.  
  16.    public void begingroup() {
  17.    }
  18.  
  19.    public void close() {
  20.       Enumeration var1 = this.this$0.fontTable.keys();
  21.       this.this$0.warning("Done reading font table.");
  22.  
  23.       while(var1.hasMoreElements()) {
  24.          Integer var2 = (Integer)var1.nextElement();
  25.          this.this$0.warning("Number " + var2 + ": " + this.this$0.fontTable.get(var2));
  26.       }
  27.  
  28.    }
  29.  
  30.    public void endgroup(Dictionary var1) {
  31.    }
  32.  
  33.    public void handleBinaryBlob(byte[] var1) {
  34.    }
  35.  
  36.    public boolean handleKeyword(String var1) {
  37.       if (var1.charAt(0) == 'f') {
  38.          this.nextFontFamily = var1.substring(1);
  39.          return true;
  40.       } else {
  41.          return false;
  42.       }
  43.    }
  44.  
  45.    public boolean handleKeyword(String var1, int var2) {
  46.       if (var1.equals("f")) {
  47.          this.nextFontNumber = var2;
  48.          return true;
  49.       } else {
  50.          return false;
  51.       }
  52.    }
  53.  
  54.    public void handleText(String var1) {
  55.       int var2 = var1.indexOf(59);
  56.       String var3;
  57.       if (var2 > 0) {
  58.          var3 = var1.substring(0, var2);
  59.       } else {
  60.          var3 = var1;
  61.       }
  62.  
  63.       this.this$0.fontTable.put(new Integer(this.nextFontNumber), var3);
  64.       this.nextFontNumber = -1;
  65.       this.nextFontFamily = null;
  66.    }
  67. }
  68.